#pragma once

#include <ddm/CtrlHandler.h>
#include <thrift/lib/cpp2/server/ThriftServer.h>

namespace ddm {
class ThriftServer {
 public:
  ThriftServer(std::shared_ptr<CtrlHandler>& handler);
  void start();
  void stop();

 private:
  std::unique_ptr<apache::thrift::ThriftServer> server_;
  std::shared_ptr<ddm::CtrlHandler> ctrlHandler_;
  std::vector<std::thread> thriftCtrlServerThreadVec_;
};
}  // namespace ddm